#define _CRT_SECURE_NO_WARNINGS 1
#include"Date.h"
//int main()
//{
//	Date d1(2023, 2, 27);
//	Date d2(2022, 1, 17);
//	int ret = d1 - d2;
//}

//int main()
//{
//    int a[13] = { 0,31,59,90,120,151,181,212,243,273,304,334,365 };
//    int year, month, day;
//    cin >> year >> month >> day;
//    int out = a[month - 1] + day;
//    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0) && month > 2)
//    {
//        cout << (out + 1);
//    }
//    else
//    {
//        cout << out;
//    }
//}



int yearDay(int year, int month, int day)
{
    int a[13] = { 0,31,59,90,120,151,181,212,243,273,304,334,365 };
    int yearDay = 0;
    for (int i = 1; i < year; i++)
    {
        if (isLeapYear(year))
        {
            yearDay += 366;
        }
        else
        {
            yearDay += 365;
        }
    }
    int out = a[month - 1] + day;
    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0) && month > 2)
    {
        return (out + 1) + yearDay;
    }
    else
    {
        return  out + yearDay;
    }
}


int main() {
    int date_1, date_2;
    cin >> date_1 >> date_2;
    int day_1 = date_1 % 100;
    date_1 /= 100;
    int day_2 = date_2 % 100;
    date_2 /= 100;
    int month_1 = date_1 % 100;
    int year_1 = date_1 / 100;
    int month_2 = date_2 % 100;
    int year_2 = date_2 / 100;
    int count1 = yearDay(year_1, month_1, day_1);
    int count2 = yearDay(year_2, month_2, day_2);
    cout << (abs(count1 - count2) + 1) << endl;
    return 0;
}
